	<input type="hidden" name="fieldMap['${field.name}'].id"  <#if businessInstanceField?? && businessInstanceField.id??>value="${businessInstanceField.id}"</#if>>
	<input type="hidden" name="fieldMap['${field.name}'].field.id"  value="${formField.field.id}">
	<input type="hidden" id=${field.name} name="fieldMap['${field.name}'].value" <#if businessInstanceField??>value="${businessInstanceField.value?default('')}" </#if>></input>
<#if formField.hidden?? && formField.hidden=="1">

<#else>
	<#if formField.readonly?? && formField.readonly=="1">
		<input id="${field.name}" type="hidden" name="fieldMap['${field.name}'].entityId" <#if businessInstanceField??>value="${businessInstanceField.entityId?default('')}" </#if>></input>
		<#if businessInstanceField??>
			${businessInstanceField.value?default('')}
		</#if>
	<#else>
		
		<#if parentInstance?? && parentInstance.id??>
			<input type="hidden" id=parentInstance name="businessInstance.parentInstance.id" value="${parentInstance.id}">
		</#if>
		
		
		<#if planTaskLibrary??>
		
		<input id="${field.name}" type="hidden" name="fieldMap['${field.name}'].entityId" value="${planTaskLibrary.id}" ></input>
			${planTaskLibrary.year?default('')}
		<#else>
		
			<select id=${field.name} name="fieldMap['${field.name}'].entityId" <#if formField.width??>style="width:${formField.width};"</#if> <#if formField.readonly?? && formField.readonly=="1">disabled="true"</#if> onchange=libraryChange(this.value)>
			<#list library_list as pt>
				<#assign c = "pt.${field.entityValueField}">
				<option value="${pt.id}" <#if businessInstanceField?? && businessInstanceField.value?? && businessInstanceField.value==c?eval >selected</#if>>${c?eval}</option>
			</#list>
			</select>
			
			
		</#if>
		
		
		
		
		
	</#if>
</#if>

<script language="JavaScript">
	function libraryChange(value){
		 <#list library_list as pt>
		 if(value === "${pt.id}"){
		 	$("#parentInstance").attr("value","${pt.businessInstance.id}");
		 }
		 </#list>
	}
	
</script>